1. Field of the Invention
This invention relates to the field of frame buffers for computer systems. More particularly, to a method and apparatus for quickly copying information from a first region of memory in a frame buffer to a second region of memory in the frame buffer.
2. Art Background
Many computer systems use a region of memory called a frame buffer for storing data that is to be displayed on a graphics display screen. A display control system reads the information in the frame buffer line-by-line, converts the information into an analog video signal using a digital to analog converter (DAC), and transmits the analog video signal to a display screen. The line-by-line scanning generally beginning at a region in the frame buffer corresponding to the upper left-hand corner of the display screen and continuing to the lower right-hand corner.
Typically, a frame buffer is constructed of video random access memory (VRAM) devices that differ from conventional dynamic random access memory (DRAM) devices by having two access ports instead of just one access port. A first access port, called a random access port, provides conventional random access to the VRAM such that a central processing unit coupled to the VRAM may read or write to any memory location in the VRAM. A second port, called a serial access port, provides simultaneous serial access to the VRAM such that a device coupled to the serial port can shift data in or out of the VRAM. A display circuit usually accesses the serial port to furnish pixel data to the circuitry controlling the output display. In such a configuration, a central processing unit can write to the VRAM while a display circuit continually furnishes information to an output display.
To animate objects on a display screen coupled to a frame buffer based display system, animation software renders a series of frames with slight picture changes in each frame. To provide smooth animation, approximately 15 to 30 new frames should be displayed each second. As the picture in one frame changes to the picture in the next frame, continuous motion is presented. To accomplish this, the frame buffer must be continually updated.
The ability of a frame buffer to both receive information and transfer that information to an output display simultaneously causes certain difficulties. If the animation software writes to frame buffer memory while the display controller is scanning the image in the frame buffer memory to a display, then the display may present information from more than one animation frame at time. This problem is referred to as frame tear. Frame tears are only important where motion from one frame to the next causes the elements presented on the display to be obviously distorted. When this occurs, the distortion caused may be extremely disconcerting to the viewer.
To eliminate frame tears, certain computer systems utilize a system referred to as double buffering. A double buffered system provides two regions of memory in the frame buffer wherein each region of memory may furnish pixel information to the circuitry controlling the output display. A first region of memory provides a first animation frame to the output display, and no changes are made in that memory region while it provides information to the display screen. While the first memory region is displayed on the display screen, animation software renders the next animation frame in the second region of memory. When the animation software completes the next animation frame the display is changed such that the second region of memory becomes the displayed frame and the first region of memory becomes the "work" region in which the animation software renders the next animation frame. In this manner, no pixel information is ever written to the region of memory that is displayed on the display screen. The effect of writing to the non-displayed buffer is that frame tears cannot occur.
When animating objects using a double-buffered animation frame, the CPU must render every object to be displayed in the work region for each new frame of animation. If the animated objects are being rendered on top of a background scene, the entire background scene must also be redrawn by the CPU before it can render the animated objects. To provide high-quality real time animation, the rendering of the background and the animated objects for an animation frame must be done approximately 15 to 30 times per second. Real-time animation therefore usually requires a very fast computer processor.